package cn.young.javalearning.designpattern.prototype.simple;

public class PrototypeA implements Prototype {
    private String name;
    private String age;

    public String getName() {
        return name;
    }

    public PrototypeA setName(String name) {
        this.name = name;
        return this;
    }

    public String getAge() {
        return age;
    }

    public PrototypeA setAge(String age) {
        this.age = age;
        return this;
    }

    @Override
    public String toString() {
        return "PrototypeA{" +
                "name='" + name + '\'' +
                ", age='" + age + '\'' +
                '}';
    }

    @Override
    public Prototype clone() {
        PrototypeA prototypeA = new PrototypeA();
        prototypeA.setAge(this.age);
        prototypeA.setName(this.name);
        return prototypeA;
    }
}
